]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
texture-cache: use scale factor for load_uri_async()
authorCosimo Cecchi <cosimoc@gnome.org>
Sun, 23 Mar 2014 04:05:53 +0000 (21:05 -0700)
committerCosimo Cecchi <cosimoc@gnome.org>
Fri, 28 Mar 2014 17:53:01 +0000 (10:53 -0700)
https://bugzilla.gnome.org/show_bug.cgi?id=726907

js/gdm/loginDialog.js
js/ui/components/telepathyClient.js
src/st/st-texture-cache.c
src/st/st-texture-cache.h

index 68b4ee18982a79f1106d544b642e54bed3651372..0b8940a3414f16faae2e3a998f52939818d6ae53 100644 (file)
@@ -537,9 +537,12 @@ const LoginDialog = new Lang.Class({
             return;
 
         this._logoBin.destroy_all_children();
-        if (this._logoFileUri)
+        if (this._logoFileUri) {
+            let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
             this._logoBin.add_child(this._textureCache.load_uri_async(this._logoFileUri,
-                                                                      -1, _LOGO_ICON_HEIGHT));
+                                                                      -1, _LOGO_ICON_HEIGHT,
+                                                                      scaleFactor));
+        }
     },
 
     _updateLogo: function() {
index cbe7a18f8cc9d0c8c11a6270a7915627c7dab502..49f1e3e1ea516743294a21c00972221be2cfb33a 100644 (file)
@@ -1270,7 +1270,8 @@ const SubscriptionRequestNotification = new Lang.Class({
 
         if (file) {
             let uri = file.get_uri();
-            iconBox.child = textureCache.load_uri_async(uri, iconBox._size, iconBox._size);
+            let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
+            iconBox.child = textureCache.load_uri_async(uri, iconBox._size, iconBox._size, scaleFactor);
         }
         else {
             iconBox.child = new St.Icon({ icon_name: 'avatar-default',
index 8916ebc73ea3c70f457e0c32c2178751d776c29e..fbdf7d6df70f40a6adbbdb9480a656b3e49518d2 100644 (file)
@@ -265,6 +265,7 @@ typedef struct {
 
   guint width;
   guint height;
+  guint scale;
   GSList *textures;
 
   GtkIconInfo *icon_info;
@@ -510,7 +511,7 @@ load_pixbuf_thread (GSimpleAsyncResult *result,
   g_assert (data != NULL);
   g_assert (data->uri != NULL);
 
-  pixbuf = impl_load_pixbuf_file (data->uri, data->width, data->height, 1, &error);
+  pixbuf = impl_load_pixbuf_file (data->uri, data->width, data->height, data->scale, &error);
 
   if (error != NULL)
     {
@@ -1006,7 +1007,8 @@ load_gicon_with_colors (StTextureCache    *cache,
       request->policy = policy;
       request->colors = colors ? st_icon_colors_ref (colors) : NULL;
       request->icon_info = info;
-      request->width = request->height = size * scale;
+      request->width = request->height = size;
+      request->scale = scale;
       request->enforced_square = TRUE;
 
       load_texture_async (cache, request);
@@ -1280,6 +1282,7 @@ st_texture_cache_load_sliced_image (StTextureCache *cache,
  * @uri: uri of the image file from which to create a pixbuf
  * @available_width: available width for the image, can be -1 if not limited
  * @available_height: available height for the image, can be -1 if not limited
+ * @scale: scale factor of the display
  *
  * Asynchronously load an image.   Initially, the returned texture will have a natural
  * size of zero.  At some later point, either the image will be loaded successfully
@@ -1291,7 +1294,8 @@ ClutterActor *
 st_texture_cache_load_uri_async (StTextureCache *cache,
                                  const gchar    *uri,
                                  int             available_width,
-                                 int             available_height)
+                                 int             available_height,
+                                 int             scale)
 {
   ClutterActor *texture;
   AsyncTextureLoadData *request;
@@ -1320,6 +1324,7 @@ st_texture_cache_load_uri_async (StTextureCache *cache,
       request->policy = policy;
       request->width = available_width;
       request->height = available_height;
+      request->scale = scale;
 
       load_texture_async (cache, request);
     }
index 07f40adc4447fdfa4460c2fb979277cb02c556e8..af14181b93d7c4802fd5115f0400ff2a80ef9d60 100644 (file)
@@ -90,7 +90,8 @@ ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
 ClutterActor *st_texture_cache_load_uri_async (StTextureCache    *cache,
                                                const gchar       *uri,
                                                int                available_width,
-                                               int                available_height);
+                                               int                available_height,
+                                               int                scale);
 
 CoglHandle    st_texture_cache_load_file_to_cogl_texture (StTextureCache *cache,
                                                           const gchar    *file_path,